Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Arithmetic built-in functions

Table 2–9 describes some of the useful built-in functions that extend the basic set of numeric operands.

Table 2–9: Arithmetic built-in functions
Function
Arguments
Returned value
ABSOLUTE 
value AS INTEGER or DECIMAL.
INTEGER or DECIMAL — The absolute value of the numeric value.
EXP 
base AS INTEGER or DECIMAL, exponent AS INTEGER or DECIMAL.
INTEGER or DECIMAL— The result of raising the base number to the exponent power.
LOG 
expression AS DECIMAL, base AS INTEGER or DECIMAL.
DECIMAL— The logarithm of the expression using the specified base. The base is optional; the natural logarithm, base (e), is returned by default.
MAXIMUM 
two or more expressions AS INTEGER or DECIMAL.
INTEGER or DECIMAL— The largest value of the expressions.
MINIMUM 
two or more expressions AS INTEGER or DECIMAL.
INTEGER or DECIMAL— The smallest value of the expressions.
MODULO 
This function has the special syntax: expression MODULO base.
INTEGER— The remainder after division. The expression and base must be INTEGER values.
RANDOM 
low-value AS INTEGER, high-value AS INTEGER.
INTEGER — A random INTEGER value between the low-value and the high-value (inclusive). There is a Random (–rand) Progress startup option that determines whether a different set of values is returned for each OpenEdge session.
ROUND 
expression AS DECIMAL, precision AS (positive) INTEGER.
DECIMAL — The DECIMAL expression rounded to the number of decimal places specified by the precision. The rounding is down for all values beyond the precision that are less than .5, and up for all higher values.
SQRT 
expression AS INTEGER or DECIMAL.
DECIMAL — The square root of the expression.
TRUNCATE 
expression AS DECIMAL, precision AS (non-negative) INTEGER.
DECIMAL — The expression truncated to the specified precision.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095